home *** CD-ROM | disk | FTP | other *** search
- #!/bin/csh -f
- #
- # eps2gif Encapsulated-PostScript-File [GIF-Output-File]
- #
- # this tool uses Impressario's PSRIP utility and several PBM-Plus tools
- # to convert Encapsulated PostScript files to a reasonable looking GIF image.
-
- # verify we have a figure name specified
- set INFILE=$1
- if ( "$INFILE" == "" ) then
- echo "Usage: eps2gif Encapsulated-PostScript-File [GIF-Output-File]"
- exit
- endif
-
- # check to see that it ends in .epd .ps, .PS, or .ai; .ps and .PS
- # are supported for backwards compatibility
- set FIGURE=`basename $INFILE`
- set BASE=`basename $FIGURE .eps`
- if ( "$BASE" == "$FIGURE" ) then
- set BASE=`basename $FIGURE .ai`
- if ( "$BASE" == "$FIGURE" ) then
- set BASE=`basename $FIGURE .ps`
- if ( "$BASE" == "$FIGURE" ) then
- set BASE=`basename $FIGURE .PS`
- if ( "$BASE" == "$FIGURE" ) then
- echo "eps2gif: suffix must be either .eps, .ai, .ps, or .PS"
- exit
- endif
- endif
- endif
- endif
-
- # setup the output file
- set OUTFILE=$2
- if ( "$OUTFILE" == "" ) then
- set OUTFILE=$BASE.gif
- endif
-
- # see that the user has Impressario's PSRIP tool installed
- if ( ! -f /usr/lib/print/psrip ) then
- echo "eps2gif: ERROR - you must have impr_rip.sw.impr for this to work"
- exit
- endif
-
- # run the psrip utility
- # convert tiff image to PPM
- # | crop the image
- # | convert the image to gif
- onintr clean_up
- /usr/lib/print/psrip -I /usr/lib/print/data/PSRIPprolog -S -B 8 -W 935 -H 1210 -R 110 -C rgb $1 > $BASE.rip$$
- $TOOLROOT/usr/share/Insight/bin/tifftopnm $BASE.rip$$ | $TOOLROOT/usr/share/Insight/bin/pnmcrop | $TOOLROOT/usr/share/Insight/bin/pnmmargin -white 10 | $TOOLROOT/usr/share/Insight/bin/ppmquant 256 | $TOOLROOT/usr/share/Insight/bin/ppmtogif > $OUTFILE
-
- clean_up:
- /bin/rm $BASE.rip$$
-